//
//  CreateSpotTask.m
//  ZooNgonDoiOS
//
//  Created by Anh Jun Linh Tinh on 6/26/12.
//  Copyright (c) 2012 Personal. All rights reserved.
//

#import "CreateSpotTask.h"

@implementation CreateSpotTask
-(id) initWithParams:(NSString *)name lat:(NSString *)lat lon:(NSString *)lon address:(NSString *)address{
    self = [super init];
    if(self){
        _address = address;
        _lon = lon;
        _lat = lat;
        _name = name;
    }
    return self;
}

-(void)doExecute{
    NSDictionary *params = [NSDictionary dictionaryWithKeysAndObjects:@"name",_name,@"lat",_lat,@"lon",_lon,@"address",_address,nil];
    [[RKObjectManager sharedManager].client put:@"/spot" params:params delegate:self];
}

-(void)request:(RKRequest *)request didFailLoadWithError:(NSError *)error{
    NSLog(@"cde %@",[request.response bodyAsString]);
}
-(void)request:(RKRequest *)request didLoadResponse:(RKResponse *)response{
    NSLog(@"xxxxxxxxxxx %@",[response bodyAsString]);
}

@end
